package com.jiuyue.movehouse.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * <p>
 * 
 * </p>
 *
 * @author yourFather
 * @since 2022-02-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class ExtInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Null(groups = Save.class)
    @NotNull(groups = Update.class)
      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 服务名称
     */
    @NotEmpty(message = "额外服务名称不能为空",groups = {Save.class, Update.class})
    private String name;

    /**
     * 价格
     */
    @NotNull(message = "额外服务名称不能为空",groups = {Save.class, Update.class})
    private BigDecimal price;

    /**
     * 逻辑删除
     */
    @TableLogic
    private Long deleted;

    /**
     * 更新时间
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Date updateTime;

    /**
     * 创建时间
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Date createTime;


    public @interface Save {
    }

    public @interface Update {
    }
}
